<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>JS - 1.5</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script>
        function additionnerNbre () {
            var valeurA = parseInt(document.formulaire.champA.value);
            var valeurB = parseInt(document.formulaire.champB.value);
            var elementResultat = document.formulaire.champResultat;
            
            var valeurResultat = valeurA + valeurB;
            
            elementResultat.value = valeurResultat;
        }    
        </script>
    </head>
    
    <body>
        <form name="formulaire">
            <input type="text" name="champA" value="">
            +
            <input type="text" name="champB" value="">
            <input type="button" value="Calculer !" onclick="additionnerNbre();">
            =
            <input type="text" name="champResultat" value="">
        </form>
    </body>
</html>
